'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  let role = app.middleware.role();

  /**
   * user
   */
  router.get('/user/findOneUser', role, controller.user.findOneUser);

  router.get('/user/addUser', controller.user.addUser);
  router.get('/user/findUser', controller.user.findUser);

  /**
   * game
   */
  router.get('/game/findAllUser', role, controller.game.findAllUser);
  router.get('/game/addGame', controller.game.addGame);

  /**
   * account
   */
  router.get('/account/addAcount', role, controller.account.addAcount);
  router.get('/account/findUser', controller.account.findUser);
  router.get('/account/reduceAcount', controller.account.reduceAcount);

  /**
   * accountLog
   */
  router.get('/log/queryUserLog', controller.accountLog.queryUserLog);

  /**
   * pass
   */
  router.get('/pass/verify', controller.pass.verify);
  router.get('/pass/sendCode', controller.pass.sendCode);
  router.post('/pass/bindPhone', controller.pass.bindPhone);

};
